Skip to content

fix(sdk): make the install tree usable - #11

Closed
201815054 wants to merge 1 commit into
mainfrom
sdk/install-tree
Closed

fix(sdk): make the install tree usable#11
201815054 wants to merge 1 commit into
mainfrom
sdk/install-tree

Conversation

@201815054

@201815054 201815054 commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

cmake --install produced a tree that could not build or run a generated model.

Problems

Missing headers. Generated model code includes visp/nn.h and helpers from src/util/, neither of which was installed.

No runner source. There was nothing to compile a generated <Arch>.cpp against, so consumers copied a runner out of the source tree by hand.

No RUNPATH. The installed libvisioncpp.so records libggml.so.0 in DT_NEEDED but had no RUNPATH. Linking succeeds and startup fails:

./run: error while loading shared libraries: libggml.so.0: cannot open shared object file

The linker resolves the path CMake gives it at build time; the loader searches again at run time and had nothing to go on. Every consumer worked around it with LD_LIBRARY_PATH.

Changes

  • Install src/visp/nn.h and the headers under src/util/.
  • Install the existing generic runner tools/verify/backbone/run_dump.cpp, exported as VISP_RUNNER from the CMake package config.
  • Set CMAKE_INSTALL_RPATH to $ORIGIN. ggml installs next to libvisioncpp, so the loader finds it with no environment variable.

The runner gains two switches it needs to be useful outside this tree:

Variable Effect
VISP_BACKEND=cpu Force the CPU device. backend_init() picks an accelerator backend that a build may include but a machine may not have, and that choice fails late and unhelpfully.
VISP_DUMP_NODES=<dir> Write every named intermediate as <name>.bin. Comparing only the final output says that something diverged, not where.

Verification

Built a generated model against the install tree with nothing but:

find_package(visioncpp REQUIRED)
add_executable(run ${VISP_RUNNER} ${GEN}/${ARCH}.cpp)
target_link_libraries(run PRIVATE visioncpp)

Before: links, then fails on libggml.so.0. After: runs and writes its output, no LD_LIBRARY_PATH. objdump -x confirms RUNPATH $ORIGIN on the installed library.

Independent of #12 and #13.

🤖 Generated with Claude Code

`cmake --install` produced a tree that could not build or run a generated
model.

  - Generated code includes `visp/nn.h` and helpers from `src/util/`, neither
    of which was installed.
  - There was no runner source to compile a generated `<Arch>.cpp` against, so
    consumers copied one out of the source tree by hand.
  - The installed `libvisioncpp.so` records `libggml.so.0` in DT_NEEDED but
    had no RUNPATH. Linking succeeded and startup failed with
    "libggml.so.0: cannot open shared object file" -- the linker resolves the
    path CMake gives it, the loader searches again at run time and had nothing
    to go on. Every consumer worked around it with LD_LIBRARY_PATH.

Installs the missing headers, installs the existing generic runner
`tools/verify/backbone/run_dump.cpp` as `VISP_RUNNER` in the package config,
and sets `CMAKE_INSTALL_RPATH` to `$ORIGIN`. ggml installs next to
libvisioncpp, so the loader finds it with no environment variable.

The runner gains two switches it needs to be useful outside this tree:
`VISP_BACKEND=cpu` forces the CPU device, because `backend_init()` picks an
accelerator backend that a build may include but a machine may not have; and
`VISP_DUMP_NODES=<dir>` writes every named intermediate, because comparing
only the final output says that something diverged, not where.

Verified by building a generated model against the install tree with nothing
but find_package(visioncpp): it links, runs, and writes its output.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@201815054

201815054 commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator Author

Closing while a larger issue is investigated: with a trained checkpoint the pipeline does not reproduce the reference detections. Reproduced on main, so it predates these changes, but there is no point reviewing documentation for a flow whose end-to-end correctness is in question.

@201815054 201815054 closed this Aug 7, 2026
@201815054
201815054 deleted the sdk/install-tree branch August 18, 2026 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant